﻿<!doctype html>

<html>
<head>
    {% if page_title %}
    <title>{{ page_title|safe }}</title>
    {% else %}
    <title>{{ config.TITLE|safe }}</title>
    {% endif %}
    <meta charset="utf-8">
    <script src="{{ static('js/main.js') }}"></script>
    <link rel="stylesheet" href="{{ static('css/style.css') }}">
    {% block head %}{% endblock %}
</head>

<body>
    <div>
        {% if req.current_user() %}
            <a href="{{ url_for('signout') }}">注销</a>
        {% else %}
            <a href="{{ url_for('signup') }}">注册</a>
            <a href="{{ url_for('signin') }}">登录</a>
        {% endif %}
    </div>
    {% for msg in get_messages() %}
        {% if msg.tag == 'success' %}
            <div class="ui-green">
                {{ msg.txt }}
            </div>
        {% elif msg.tag == 'error' %}
            <div class="ui-red">
                {{ msg.txt }}
            </div>
        {% endif %}
    {% endfor %}

    {% block body %}{% endblock %}
    {% block script %}{% endblock %}
</body>
</html>
